import React from 'react';
import PropTypes from 'prop-types';
import './index.scss';
import Breadcrumbs from '../../components/breadcrumbs/index';
import ArcList from './arc_list/index';

class ArticleListContainer extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      currentTitle: '',
    }
    this.getCurrentTitle = this.getCurrentTitle.bind(this)
  }
  // 获取当前的面包屑导航
  getCurrentTitle(title) {
    this.setState({
      currentTitle: title,
    })
  }
  render() {
    return (
      <div id="article-list-container">
        <div className="w">
          <div className="container">
            <Breadcrumbs currentTitle={this.state.currentTitle} />
            <ArcList
              cateId={this.props.cateId}
              perPage={10}
              getCurrentTitle={this.getCurrentTitle}
            />
          </div>
        </div>
      </div>
    )
  }
}
export default ArticleListContainer;
ArticleListContainer.propTypes = {
  cateId: PropTypes.number,
}
